@extends('home.index.layout')
@section('content')
<!-- <div role="toolbar" class="c-featured-slider slick-initialized slick-slider" data-component="FeaturedArticlesSlider"> -->

<div class="c-archive-header o-full-width" style="background-image:url('{{ url("/uploads") }}/{{ $cateData -> headimg }}')">
    <div class="o-wrapper o-wrapper--large">
      <h1 class="c-archive-header__title"> {{ $cateData->name }}  </h1>
      <p class="c-archive-header__desc"></p>
    </div>
  </div>

<div id="focusViwer">

  <div id="imgADPlayer" style="margin:0 auto;width: 80%;">
    
</div> 
  
  
</div>

<div class="o-wrapper c-home">

     <article id="articles-collection" class="o-wrapper o-matrix o-matrix--large">
     
     <div class="o-matrix__row">

     <div class="o-matrix__row">

@foreach($data as $goods)
@if($goods -> zstyle == 0)
<div class="o-matrix__row__unit goods" style='margin-bottom:20px;padding-left: 10px'>
    <div class="c-card c-card-article c-card--shadowed c-card-article--darken" data-post-id="722044">
          <label ga-track="event" ga-action="click" ga-event-category="Class" ga-event-label="Tag" class="c-card-article__label"><a class="c-card-article__label__link" href="#" target="_blank">
          
          
          {{ $cateData->name }}  
         
          
          
          </a></label>
        <div class="c-card-article__thumbnail" style="background-image:{{ url('/uploads') }}/{{ $goods -> img_head }}"><img class='img' width='100%' height='160' src="{{ url('/uploads') }}/{{ $goods -> img_head }}">
    </div>
          <div class="c-card-article__contents">
        <a class="c-card-article__link" href="{{ url('/home/content/detail') }}" target="_blank">
          <h1 class="c-card-article__title title">
            {{ $goods -> title }}
          </h1>
        </a>
        <div class="c-card-article__meta c-card-meta c-card-meta--bottom">
          <time class="c-card-article__time c-card-meta__info c-card-meta__info--left time">{{ $goods -> time }}</time>
          <span class="c-card-meta__info c-card-meta__info--right c-card-meta__info--like js-article-like-count">3</span>
          <span class="c-card-meta__info c-card-meta__info--right c-card-meta__info--comments">0</span>
        </div>
      </div>
        <a class="c-card-article__thumbnail__link more" href="{{ url('/home/index/detail') }}/{{ $goods -> id }}" target="_blank"></a>
  </div>
</div> 
@endif 

@if($goods -> zstyle ==1 )
  <!-- 第一排第二块产品项 -->
         <div class="o-matrix__row__unit o-matrix__row__unit--2x1" style="margin-bottom: 20px">
                <div class="c-card c-card-article c-card--shadowed c-card-article--darken c-card-article--thumbnail c-card-article--thumbnail__layer" data-post-id="722819">

                    <label class="c-card-article__label"><a class="c-card-article__label__link" href="分类网站连接">
                     
                        {{ $cateData->name }}        
                      

                    </a></label>

                   <div class="c-card-article__thumbnail" style="background-image:url('{{ url("/uploads") }}/{{ $goods -> img_head }}')">
                   <a class="c-card-article__thumbnail__link" href="#" target="_blank"></a>
                   <h1 class="c-card-article__title"><a class="c-card-article__link" href="#" target="_blank">{{ $goods -> title }}</a></h1>
                   </div>
                </div>
         </div>
@endif

@if($goods -> zstyle ==2)

  <div class="o-matrix__row__unit" style="margin-bottom: 20px;">
      <div class="c-card c-card-article c-card--shadowed" data-post-id="722742" style="margin-left:0px">
          <label ga-track="event" ga-action="click" ga-event-category="Class" ga-event-label="Tag" class="c-card-article__label"><a class="c-card-article__label__link" href="分类连接" target="_blank">
              
                 {{ $cateData->name }}        
             
          </a></label>

          <div class="c-card-article__thumbnail" style="background-image:url('{{ url("/uploads") }}/{{ $goods -> img_head }}')"></div>

          <div class="c-card-article__contents">
            <a class="c-card-article__link" href="#" target="_blank"><h1 class="c-card-article__title">  <!-- 标题内容 --> {{ $goods -> title }} </h1>
            </a>

            <div class="c-card-article__meta c-card-meta c-card-meta--bottom">
                <time class="c-card-article__time c-card-meta__info c-card-meta__info--left">{{ $goods -> time }}</time>
                <span class="c-card-meta__info c-card-meta__info--right c-card-meta__info--like js-article-like-count">0</span>
                <span   class="c-card-meta__info c-card-meta__info--right c-card-meta__info--comments">1</span>
            </div>
          </div>

          <a class="c-card-article__thumbnail__link" href="#" target="_blank"></a>
      </div>
    </div> 
  
@endif
@endforeach



</div>


</article>

  </div>
   <button class="c-load-more__button js-load-more btn">加载更多</button>
    <script type="text/javascript">

        //分页
        
       $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                 }
          });
       var p = 1;
       
     
        alert($);
        //添加滚动事件
        $('.btn').on('click', function(){
            $.ajax({

                url:"{{ url('/home/index/index') }}",
                data:{p:p},
                type:"GET",
                success:function()
                {
                alert(111);
                   
                },

                error:function()
                {
                    alert(222);
                },
                dataType:'json'
            });
        alert(333);
        }

    </script>

  @endsection('content')